<?php
namespace App\Constant;
class ApiUrl {
 // API 基础地址
 public static $baseApiUrl = 'https://sxsx.jxeduyun.com:7780';
 public static $pushbaseApiUrl = 'https://www.pushplus.plus/api';
 // 18点26更新

    // 登录获取token的 API URL
    public static function getLoginUrl()
    {
        return self::$baseApiUrl.'/portal-api/app/index/login';
    }

    // 获取实习id
    public static function getStudentPlanId()
    {
        return self::$baseApiUrl.'/portal-api/app/index/getStudentPlan';
    }
    /**
     * 打卡地址
     * @return string
     */
    public static function getDawnUrl()
    {
        return self::$baseApiUrl.'/portal-api/practice/autonomyClock/add';
    }


    /**
     * 上传日志地址
     * @return string
     */
    public static function getLogUrl()
    {
        return self::$baseApiUrl.'/portal-api/practice/autonomyDailPaper/add';
    }

    /**
     * 获取日志列表地址
     * 
     * @return string
     */
    public static function getLogListUrl(string $autonomyId, string $userId, string $pageNum, string $pageSize)
    {
        return sprintf(
            '%s/portal-api/practice/autonomyDailPaper/getPaperEvaluate?planId=&autonomyId=%s&userId=%s&pageNum=%s&pageSize=%s',
            self::$baseApiUrl,
            $autonomyId,
            $userId,
            $pageNum,
            $pageSize
        );
    }

    /**
     * 获取详细日志列表地址
     * 
     * @return string
     */
    public static function getLogDatailUrl(string $id)
    {
        return sprintf(
            '%s/portal-api/practice/autonomyDailPaper/info?id=%s',
            self::$baseApiUrl,
            $id,
        );
    }

    /**
     * 
     * 获取文件上传地址
     * @return string
     */
    public static function getUploadFileUrl()
    {
        return self::$baseApiUrl.'/portal-api/common/uploadFileUrl';
    }

    /**
     * 获取打卡列表
     * @param string $autonomyPlanId 自主计划ID
     * @param string $userId 用户ID
     * @param string $queryDate 查询日期
     * @return string
     */
    public static function getLogs(string $autonomyPlanId, string $userId, string $queryDate)
    {
        return sprintf(
            '%s/portal-api/practice/autonomyClock/getStuDailyClock?autonomyId=%s&userId=%s&queryDate=%s&beginQueryDate=&endQueryDate=',
            self::$baseApiUrl,
            $autonomyPlanId,
            $userId,
            $queryDate
        );
    }



   /**
     * 
     * 获取AccessKey
     * @return string
     */
    public static function getPushAccessKey()
    {
        return self::$pushbaseApiUrl.'/common/openApi/getAccessKey';
    }

 /**
     * 
     * 获取个人二维码
     * @return string
     */
    public static function getQrCode()
    {
        return self::$pushbaseApiUrl.'/open/friend/getQrCode?appId='.env('PUSH_APPID').'&content=123';
    }

     /**
     * 
     * 获取微信登录
     * @return string
     */
    public static function getWechatQrcode()
    {
        return self::$pushbaseApiUrl.'common/wechat/getQrcode';
    }

     /**
     * 
     * 发送信息
     * @return string
     */
    public static function sendMsg($data)
    {
        return 'http://miaotixing.com/trigger?' . http_build_query([
            'id' => $data['token'],
            'text' => $data['msg']
        ]);
    }

    /**
     * 
     * 好友列表
     * @return string
     */
    public static function getFriendList()
    {
        return self::$pushbaseApiUrl.'/open/friend/list';
    }

    /**
     * 
     * 移除好友
     * @return string
     */
    public static function deleteFriend($friendId)
    {
        return self::$pushbaseApiUrl.'/open/friend/deleteFriend?friendId='.$friendId;
    }

    /**
     * 
     * 修改备注
     * @return string
     */
    public static function editRemark()
    {
        return self::$pushbaseApiUrl.'/open/friend/editRemark';
    }
}